package mainFiles;
import java.math.BigDecimal;



/**
 * Represents a class within the gym management system.
 * @author Emily Linniman
 * @version November 26, 2014
 *
 */
public class Class {
	
	/** The id of the class. */
	private String id;
	
	/** The name of the class. */
	private String name;
	
	/** The maximum size in number of members of the class. */
	private int size;
	
	/** The cost of the class. */
	private BigDecimal cost;
	
	/** The day the class occurs. */
	private String day;
	
	/** The time the class occurs. */
	private String time;
	
	/** The description of the class. */
	private String description;
	
	/** The location the class is held. */
	private String location;
	
	/** the instructor of the class. */
	private String instructor;
	
	/**
	 * Constructs a new class.
	 * 
	 * @param id the id of the class to be created
	 * @param name the name of the class to be created
	 * @param size the size of the class to be created
	 * @param cost the cost of the class to be created
	 * @param day the day of the class to be created
	 * @param time the time of the class to be created
	 * @param description the description of the class to be created
	 * @param instructor the instructor of the class to be created
	 * @param location the location of the class to be created
	 */
	public Class(String id, String name, int size, BigDecimal cost, String day, String time,
					String description, String instructor, String location) {
		setID(id);
		setName(name);
		setSize(size);
		setCost(cost);
		setDay(day);
		setTime(time);
		setDescription(description);
		setInstructor(instructor);
		setLocation(location);
	}
	
	/**
	 * Sets the id of the class object.
	 * @param id the id to set the class id to
	 */
	public void setID(String id) {
		if (id == null || id.length() != 9) {
			throw new IllegalArgumentException("Please enter a valid id.");
		}
		this.id = id;
	}
	
	/**
	 * Gets the id of the class object.
	 * @return the id of the class object.
	 */
	public String getID() {
		return id;
	}
	
	/**
	 * Sets the name of the class object.
	 * @param name the name to set the class name to
	 */
	public void setName(String name) {
		if (name == null){
			throw new IllegalArgumentException("Please enter a valid name.");
		}
		this.name = name;
	}
	
	/**
	 * Gets the name of the class object.
	 * @return the name of the class object
	 */
	public String getName() {
		return name;
	}
	
	/**
	 * Sets the size of the class object.
	 * @param size the size to set the class size to
	 */
	public void setSize(int size) {
		if (size <= 0) {
			throw new IllegalArgumentException("Size must be greater than 0.");
		}
		this.size = size;
	}
	
	/**
	 * Gets the size of the class object.
	 * @return the size of the class object
	 */
	public int getSize() {
		return size;
	}
	
	/**
	 * Sets the cost of the class object.
	 * @param cost the cost to set the class object cost to
	 */
	public void setCost(BigDecimal cost) {
		this.cost = cost;
	}
	
	/**
	 * Gets the cost of the class object.
	 * @return the cost of the class object.
	 */
	public BigDecimal getCost() {
		return cost;
	}
	
	/**
	 * Sets the day the class object occurs.
	 * @param day the day to set the class object to occur
	 */
	public void setDay(String day) {
		if (day == null) {
			throw new IllegalArgumentException("Please enter a valid day.");
		}
		this.day = day;
	}
	
	/**
	 * Gets the day the class object occurs.
	 * @return the day the class object occurs
	 */
	public String getDay() {
		return day;
	}
	
	/**
	 * Sets the time the class object is to occur.
	 * @param time the time to set the class object to occur at
	 */
	public void setTime(String time) {
		if (time == null) {
			throw new IllegalArgumentException("Please etner a valid time.");
		}
		this.time = time;
	}
	
	/**
	 * Gets the time the class object is to occur
	 * @return the time the class object is to occur
	 */
	public String getTime() {
		return time;
	}
	
	/**
	 * Sets the description of the class object.
	 * @param description the description to set the class description to
	 */
	public void setDescription(String description) {
		this.description = description;
	}
	
	/**
	 * Gets the description of the class object. 
	 * @return the description of the class object.
	 */
	public String getDescription() {
		return description;
	}
	
	/**
	 * Sets the location of the class object.
	 * @param location the location to set the class location to
	 */
	public void setLocation(String location) {
		this.location = location;
	}
	
	/**
	 * Gets the location of the class object.
	 * @return the location of the class object.
	 */
	public String getLocation() {
		return location;
	}
	
	/**
	 * Sets the instructor of the class object.
	 * @param instructor the instructor to set the class instructor to
	 */
	public void setInstructor(String instructor) {
		this.instructor = instructor;
	}
	
	/**
	 * Gets the instructor of the class object.
	 * @return the instructor of the class object.
	 */
	public String getInstructor() {
		return instructor;
	}
}
